package com.ruoyi.info.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.info.mapper.ProductAdaptationMapper;
import com.ruoyi.info.domain.ProductAdaptation;
import com.ruoyi.info.service.IProductAdaptationService;

/**
 * 适配信息Service业务层处理
 * 
 * @author wangshi
 * @date 2023-06-07
 */
@Service
public class ProductAdaptationServiceImpl implements IProductAdaptationService 
{
    @Autowired
    private ProductAdaptationMapper productAdaptationMapper;

    /**
     * 查询适配信息
     * 
     * @param id 适配信息主键
     * @return 适配信息
     */
    @Override
    public ProductAdaptation selectProductAdaptationById(Long id)
    {
        return productAdaptationMapper.selectProductAdaptationById(id);
    }

    /**
     * 查询适配信息列表
     * 
     * @param productAdaptation 适配信息
     * @return 适配信息
     */
    @Override
    public List<ProductAdaptation> selectProductAdaptationList(ProductAdaptation productAdaptation)
    {
        return productAdaptationMapper.selectProductAdaptationList(productAdaptation);
    }

    /**
     * 新增适配信息
     * 
     * @param productAdaptation 适配信息
     * @return 结果
     */
    @Override
    public int insertProductAdaptation(ProductAdaptation productAdaptation)
    {
        productAdaptation.setCreateTime(DateUtils.getNowDate());
        return productAdaptationMapper.insertProductAdaptation(productAdaptation);
    }

    /**
     * 修改适配信息
     * 
     * @param productAdaptation 适配信息
     * @return 结果
     */
    @Override
    public int updateProductAdaptation(ProductAdaptation productAdaptation)
    {
        productAdaptation.setUpdateTime(DateUtils.getNowDate());
        return productAdaptationMapper.updateProductAdaptation(productAdaptation);
    }

    /**
     * 批量删除适配信息
     * 
     * @param ids 需要删除的适配信息主键
     * @return 结果
     */
    @Override
    public int deleteProductAdaptationByIds(Long[] ids)
    {
        return productAdaptationMapper.deleteProductAdaptationByIds(ids);
    }

    /**
     * 删除适配信息信息
     * 
     * @param id 适配信息主键
     * @return 结果
     */
    @Override
    public int deleteProductAdaptationById(Long id)
    {
        return productAdaptationMapper.deleteProductAdaptationById(id);
    }
}
